/*
 * CarWS.java
 * 
 * Created: Feb 17, 2015
 * 
 * Copyright (c) ExpertPB 2014
 * All information contained herein is, and remains the property of
 * ExpertPB and its suppliers, if any.
 */
package com.emex.app.web;

import com.emex.app.shared.data.Car;
import com.emex.app.shared.ws.CarWebService;
import com.emex.app.web.service.CarService;
import java.util.List;
import javax.ejb.Stateless;
import javax.jws.WebService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.context.support.SpringBeanAutowiringSupport;

/**
 *
 * @author Sergey Karavaev
 */
@WebService(serviceName = "CarWS", portName = "CarWSPort", targetNamespace = "http://emex.com/Car")
@Stateless(name = "CarWS")
public class CarWS extends SpringBeanAutowiringSupport implements CarWebService {

    @Autowired
    private CarService carService;

    @Override
    public int deleteByPrimaryKey(Integer id) {
        return carService.deleteByPrimaryKey(id);
    }

    @Override
    public Car insert(Car record) {
        return carService.insert(record);
    }

    @Override
    public Car selectByPrimaryKey(Integer id) {
        return carService.selectByPrimaryKey(id);
    }

    @Override
    public Car updateByPrimaryKey(Car record) {
        return carService.updateByPrimaryKey(record);
    }

    @Override
    public List<Car> getAllCarsByClientId(Integer clientId) {
        return carService.getAllCarsByClientId(clientId);
    }
}
